import { add } from "./js/add";
import "./css/index.css";
import "./css/box2.less";

const result = add(3, 4, 6, 7);
console.log(result);

// 动态导入
document.getElementById("btn").onclick = function () {
  // eslint支持动态导入需要引入plugins
  // webpack魔法命名
  import(/* webpackChunkName:"count" */ "./js/count.js").then(({ count }) => count(1, 3));
};

// js使用HMR，对应的react使用react-hot-loader插件
if (module.hot) {
  module.hot.accept("./js/add");
}

// 引入ES6新特性使用core-js按需打包
new Promise(resolve => {
  setTimeout(resolve, 200);
});
const arrs = [1, 2, 3];
console.log(arrs.includes(2));
